const utils = require('j7/utils');
const bcutils = require('j7/bcutils');
const basewrap = require('./basewrap');
const metaFactory = require('./factory');

const tokenIdHash = {};

class AirDrop extends basewrap.BaseWrap {

  _init0 () {
    if (utils.hasKey(tokenIdHash, this['token_id'])) {
      throw 'airdrop token_id error';
    }
    tokenIdHash[this['token_id']] = this;
    console.log(this);
  }

  static getAirDropByTokenId(tokenId) {
    return utils.hasKey(tokenIdHash, tokenId) ? tokenIdHash[tokenId] : null;
  }

}

module.exports = AirDrop;
